// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_activity;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;
import android.os.PowerManager;
import com.nnee.p_a.p_a.cls_e;
import com.nnee.p_g.cls_b;
import com.nnee.p_pr.p_a.cls_f;
import com.nnee.p_pr.p_a.cls_h;
import com.nnee.p_pr.p_a.cls_i;
import java.io.File;

// Referenced classes of package com.nnee.p_pr.p_activity:
//            OfflineDownloadError, cl

class cls_cq extends AsyncTask
{

    public cls_cq(cls_OfflineDownloadError offlinedownloaderror, Context context)
    {
        d = offlinedownloaderror;
        super();
        e = context;
        f = ((PowerManager)e.getSystemService("power")).newWakeLock(1, "CacheClearTask");
    }

    protected transient Integer a(Void avoid[])
    {
        String s;
        String s1;
        s = com.nnee.p_a.p_a.cls_e.d();
        s1 = com.nnee.a.a.e.e();
        File file;
        f.acquire();
        i.f(s1);
        file = new File(s);
        if(file.exists()) goto _L2; else goto _L1
_L1:
        Integer integer3;
        com.nnee.p_pr.p_c.cls_i.b(d, null);
        integer3 = Integer.valueOf(1);
        Integer integer1;
        integer1 = integer3;
        if(f != null && f.isHeld())
        {
            f.release();
            f = null;
        }
        com.nnee.p_a.p_a.cls_e.b(s);
        com.nnee.p_a.p_a.cls_e.b(s1);
_L7:
        return integer1;
_L2:
        String as[];
        int j;
        as = file.list();
        if(as != null)
            break MISSING_BLOCK_LABEL_201;
        j = 0;
_L3:
        Integer integer2;
        if(j != 0)
            break MISSING_BLOCK_LABEL_209;
        String as2[] = new String[2];
        as2[0] = String.valueOf(100);
        as2[1] = "0";
        publishProgress(as2);
        com.nnee.p_pr.p_c.cls_i.b(d, null);
        integer2 = Integer.valueOf(3);
        integer1 = integer2;
        if(f != null && f.isHeld())
        {
            f.release();
            f = null;
        }
        com.nnee.p_a.p_a.cls_e.b(s);
        com.nnee.p_a.p_a.cls_e.b(s1);
        continue; /* Loop/switch isn't completed */
        j = as.length;
          goto _L3
        long l;
        int k;
        com.nnee.p_a.p_a.cls_e.a(s);
        com.nnee.p_a.p_a.cls_e.a(s1);
        cls_OfflineDownloadError.a(d).setMax(j);
        l = 0L;
        k = 0;
_L4:
        if(k >= j)
            break MISSING_BLOCK_LABEL_505;
label0:
        {
            synchronized(com.nnee.p_pr.p_activity.OfflineDownloadError.b(d))
            {
                if(!OfflineDownloadError.c(d))
                    break label0;
                com.nnee.p_g.cls_b.c("doInBackground", "user cancel\uFF01");
                cls_OfflineDownloadError.a(d, false);
                integer1 = Integer.valueOf(0);
            }
            if(f != null && f.isHeld())
            {
                f.release();
                f = null;
            }
            com.nnee.p_a.p_a.cls_e.b(s);
            com.nnee.p_a.p_a.cls_e.b(s1);
            continue; /* Loop/switch isn't completed */
        }
        obj;
        JVM INSTR monitorexit ;
        File file1;
        boolean flag;
        file1 = new File(s, as[k]);
        flag = file1.exists();
        if(flag)
            break MISSING_BLOCK_LABEL_417;
_L5:
        k++;
          goto _L4
        exception1;
        obj;
        JVM INSTR monitorexit ;
        throw exception1;
        Exception exception;
        exception;
        if(f != null && f.isHeld())
        {
            f.release();
            f = null;
        }
        com.nnee.p_a.p_a.cls_e.b(s);
        com.nnee.p_a.p_a.cls_e.b(s1);
        throw exception;
        String s2;
        String as1[];
        if(file1.isFile())
            l += file1.length();
        else
        if(file1.isDirectory())
            l += com.nnee.p_pr.p_a.cls_f.e(file1);
        com.nnee.p_a.p_a.cls_e.a(file1);
        s2 = com.nnee.p_pr.p_a.cls_f.a(e, l);
        as1 = new String[2];
        as1[0] = String.valueOf(k + 1);
        as1[1] = s2;
        publishProgress(as1);
          goto _L5
        Integer integer;
        com.nnee.p_pr.p_c.cls_i.b(d, null);
        com.nnee.p_a.p_a.cls_e.c(s1);
        com.nnee.p_a.p_a.cls_e.c(s);
        integer = Integer.valueOf(1);
        integer1 = integer;
        if(f != null && f.isHeld())
        {
            f.release();
            f = null;
        }
        com.nnee.p_a.p_a.cls_e.b(s);
        com.nnee.p_a.p_a.cls_e.b(s1);
        if(true) goto _L7; else goto _L6
_L6:
    }

    protected void a(Integer integer)
    {
        if(integer.intValue() == 1)
            h.a(e, 0x7f0a0213);
        if(integer.intValue() == 0)
            h.a(e, 0x7f0a0119);
        if(integer.intValue() != 3);
        e = null;
        if(OfflineDownloadError.a(d) != null)
        {
            cls_OfflineDownloadError.a(d).dismiss();
            cls_OfflineDownloadError.a(d, null);
        }
        d.finish();
    }

    protected transient void a(String as[])
    {
        super.onProgressUpdate(as);
        int j = Integer.valueOf(as[0]).intValue();
        cls_OfflineDownloadError.a(d).setProgress(j);
        ProgressDialog progressdialog = cls_OfflineDownloadError.a(d);
        cls_OfflineDownloadError offlinedownloaderror = d;
        Object aobj[] = new Object[1];
        aobj[0] = as[1];
        progressdialog.setMessage(offlinedownloaderror.getString(0x7f0a0117, aobj));
    }

    protected Object doInBackground(Object aobj[])
    {
        return a((Void[])aobj);
    }

    protected void onPostExecute(Object obj)
    {
        a((Integer)obj);
    }

    protected void onPreExecute()
    {
        cls_OfflineDownloadError.a(d, new ProgressDialog(e));
        cls_OfflineDownloadError.a(d).setMax(100);
        cls_OfflineDownloadError.a(d).setProgressStyle(1);
        ProgressDialog progressdialog = cls_OfflineDownloadError.a(d);
        cls_OfflineDownloadError offlinedownloaderror = d;
        Object aobj[] = new Object[1];
        aobj[0] = d.getString(0x7f0a0118);
        progressdialog.setMessage(offlinedownloaderror.getString(0x7f0a0117, aobj));
        cls_OfflineDownloadError.a(d).setCancelable(false);
        cls_OfflineDownloadError.a(d).setButton(-2, d.getString(0x7f0a0105), new cl(this));
        cls_OfflineDownloadError.a(d).show();
    }

    protected void onProgressUpdate(Object aobj[])
    {
        a((String[])aobj);
    }

    public static final int a = 0;
    public static final int b = 1;
    public static final int c = 3;
    final cls_OfflineDownloadError d;
    private Context e;
    private android.os.PowerManager.WakeLock f;
}
